package company.shopee_F;

import java.util.Scanner;

public class Shopee01 {

//    private static int[][] boss;
//
//    private static int result = 0;
//    static int x, y;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        int n = sc.nextInt();
        int[][] boss = new int[x + 1][y + 1];
        for (int i = 0; i < n; i++) {
            boss[sc.nextInt()][sc.nextInt()] = 1;
        }
        long[][] dp = new long[x + 1][y + 1];
        for (int i = 0; i <= x; i++) {
            for (int j = 0; j <= y; j++) {
                if (boss[i][j] == 1)
                    dp[i][j] = 0;
                else if (i == 0 || j == 0)
                    dp[i][j] = 1;
                else
                    dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
            }
        }
        System.out.println(dp[x][y]);
    }

//    private static void helper1(int r, int c) {
//        if (c == x && r == y) {
//            result++;
//            return;
//        }
//        if (r + 1 <= y && boss[r + 1][c] == 0)
//            helper(r + 1, c);
//        if (c + 1 <= x && boss[r][c + 1] == 0)
//            helper(r, c + 1);
//    }
}
